<template>
  <view class="content">
    <image class="logo" src="/static/logo.png" />
    <view class="text-area mt-30">
      <text class="title">
        {{ title }}
      </text>
    </view>
    <fly-header />
    {{ value }}
    <button @click="add">+</button>
    <button @click="sub">-</button>
    <button @click="goTo">跳转</button>
  </view>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { useUserStore } from '@/store'
import { onShow } from '@dcloudio/uni-app'

onShow(() => {
  const pages = getCurrentPages()
  console.log('打印***pages', pages)
  console.log('个人中心页面显示trends')
})
const title = ref('Hello trends')

const user = useUserStore()
const value = ref(user.num)
const add = () => {
  value.value += 1
  user.setNum(value.value)
}

const sub = () => {
  value.value = value.value - 1
  user.setNum(value.value)
}

const goTo = () => {
  uni.navigateTo({
    url: '/pages/tabBar/home/onebyone',
  })
  // uni.switchTab({ url: '/pages/tabBar/msg/index' })
}
</script>

<style lang="scss" scoped></style>
